import request from '@/utils/request'

// 获取经纪列表
export function economicList(params) {
  return request({
    url: '/agents',
    params
  })
}

// 添加经纪
export function addAgents(data) {
  return request({
    url: '/agents',
    method: 'post',
    data
  })
}

// 获取经纪数量
// /agents/count ? name_contains = 老王
export function agentsCount(params) {
  return request({
    url: '/agents/count',
    params
  })
}

// 删除经纪
export function delAgents(id) {
  return request({
    url: '/agents/' + id,
    method: 'delete'
  })
}

// 根据id获取特定经纪
export function perAgent(id) {
  return request({
    url: '/agents/' + id
  })
}

// 编辑经纪
export function editAgent(data) {
  return request({
    url: '/agents/' + data.id,
    method: 'put',
    data
  })
}
